import java.util.Arrays;



public class TestDemo {

    public static void main(String[] args) {
        MyDate myDate = new MyDate(2020,1,1);
        //myDate.setDate(2020,1,1);
        //myDate.printDate();
        System.out.println(myDate);
       // System.out.println(myDate.flg);
        //System.out.println(myDate.str);
    }
    //构造方法的作用就是帮助我们进行对象的成员变量的初始化


    public static void swap(MyValue myVal1,MyValue myVal2) {
        int tmp = myVal1.val;
        myVal1.val = myVal2.val;
        myVal2.val = tmp;
    }
    public static void main6(String[] args) {
        MyValue myValue1 = new MyValue();
        myValue1.val = 10;

        MyValue myValue2 = new MyValue();
        myValue2.val = 20;

        System.out.println("交换前"+myValue1.val+" "+ myValue2.val);

        swap(myValue1,myValue2);

        System.out.println("交换后"+myValue1.val+" "+ myValue2.val);
    }
    public static void main5(String[] args) {
        MyDate myDate = new MyDate();
        myDate.setDate(2025,5,25);
        myDate.printDate();

        MyDate myDate2 = new MyDate();
        myDate.setDate(2026,5,27);
        myDate.printDate();

        MyDate myDate3 = new MyDate();
        myDate.setDate(2027,6,12);
        myDate.printDate();
    }

    public static void main4(String[] args) {
        int a =10;

        Dog dog1 = new Dog();
        dog1.name = "多吉";
        dog1.age =10;
        dog1.brand = "藏獒";

        System.out.println(dog1.name);
        dog1.eat();
        dog1.sleep();
        dog1.bard();

        /*
        * Dog dog2 = new Dog();
        *Dog dog3 = new Dog(); */
    }
    public static void main3(String[] args) {
        int [][] array = new int [2][];
        array[0] = new int[3];
        array[1] = new int[5];

        for (int i =0;i <array.length;i++) {
            for (int j =0;j <array[i].length;j++){
                System.out.print(array[i][j]+" ");
            }
            System.out.println();
        }

        //System.out.println(array[0]);
        //System.out.println(array[1]);
    }
    public static void main2(String[] args) {
        int [][] array = {{1,2,3},{4,5,6}};

        for (int i =0;i <array.length;i++) {
            for (int j =0;j <array[i].length;j++){
                System.out.print(array[i][j]+" ");
            }
            System.out.println();
        }
        System.out.println("行数："+array.length);
        System.out.println("列数："+array[0].length);
        System.out.println("=======================");

        for (int [] tmpArray :array) {
            for (int x:tmpArray){
                System.out.print(x+" ");
            }
            System.out.println();
        }
        System.out.println("=======================");
        System.out.println(Arrays.toString(array));
        System.out.println("=======================");
        System.out.println(Arrays.deepToString(array));
    }



    public static void main1(String[] args) {
        int [][] array = {{1,2,3},{4,5,6}};

        for (int i =0;i <2;i++) {
            for (int j =0;j <3;j++){
                System.out.print(array[i][j]+" ");
            }
            System.out.println();
        }
        int [][] array2= new int [][]{{1,2,3},{4,5,6}};
        int [][] array3 = new int [2][3];
    }
}
